package com.dreamder.model;

import java.io.Serializable;
import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name = "T_DRD_CHAT")
@SequenceGenerator(name = "chatSeq", sequenceName = "SEQ_DRD_CHAT", allocationSize = 1)
public class Chat implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6740005932400968800L;

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "chatSeq")
	@Column(name = "id_chat")
	private Long id;

	@OneToOne(optional = false, mappedBy = "chat", fetch = FetchType.LAZY)
	@JoinColumn(name = "id_sonho")
	private Sonho sonho;


	
	public Chat() {
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the sonho
	 */
	public Sonho getSonho() {
		return sonho;
	}

	/**
	 * @param sonho the sonho to set
	 */
	public void setSonho(Sonho sonho) {
		this.sonho = sonho;
	}

	
}
